package com.zret.oasys.factory;

import com.zret.oasys.operation.leave.LeaveServletOperation;

public class LeaveServletFactory {
	// 返回值是operation继承的接口(为了多态)
	public static LeaveServletOperation getOpreation(String op) {
		String classStr = "com.zret.oasys.operation.leave." + op;
		// System.out.println(classStr);
		Class<?> cla;
		Object obj = null;
		try {
			cla = Class.forName(classStr);
			obj = cla.newInstance();
		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return (LeaveServletOperation) obj;
	}
}
